class NfRectsController < ApplicationController
  # GET /nf_rects
  # GET /nf_rects.xml
  # GET /nf_rects.fxml
  def index
    @nf_rects = NfRect.find(:all)

    respond_to do |format|
      format.html # index.html.erb
      format.xml  { render :xml => @nf_rects }
      format.fxml  { render :fxml => @nf_rects }
    end
  end

  # GET /nf_rects/1
  # GET /nf_rects/1.xml
  # GET /nf_rects/1.fxml
  def show
    @nf_rect = NfRect.find(params[:id])

    respond_to do |format|
      format.html # show.html.erb
      format.xml  { render :xml => @nf_rect }
      format.fxml  { render :fxml => @nf_rect }
    end
  end

  # GET /nf_rects/new
  # GET /nf_rects/new.xml
  def new
    @nf_rect = NfRect.new

    respond_to do |format|
      format.html # new.html.erb
      format.xml  { render :xml => @nf_rect }
    end
  end

  # GET /nf_rects/1/edit
  def edit
    @nf_rect = NfRect.find(params[:id])
  end

  # POST /nf_rects
  # POST /nf_rects.xml
  # POST /nf_rects.fxml
  def create
    @nf_rect = NfRect.new(params[:nf_rect])

    respond_to do |format|
      if @nf_rect.save
        flash[:notice] = 'NfRect was successfully created.'
        format.html { redirect_to(@nf_rect) }
        format.xml  { render :xml => @nf_rect, :status => :created, :location => @nf_rect }
        format.json  { render :json => @nf_rect, :status => :created, :location => @nf_rect }
        format.fxml  { render :fxml => @nf_rect }
      else
        format.html { render :action => "new" }
        format.xml  { render :xml => @nf_rect.errors, :status => :unprocessable_entity }
        format.json  { render :json => @nf_rect.errors, :status => :unprocessable_entity }
        format.fxml  { render :fxml => @nf_rect.errors }
      end
    end
  end

  # PUT /nf_rects/1
  # PUT /nf_rects/1.xml
  # PUT /nf_rects/1.fxml
  def update
    @nf_rect = NfRect.find(params[:id])
    @saved = @nf_rect.update_attributes(params[:nf_rect])

    respond_to do |format|
      if @saved
        flash[:notice] = 'NfRect was successfully updated.'
        format.html { redirect_to(@nf_rect) }
        format.xml  { head :ok }
        format.fxml  { render :fxml => @nf_rect }
      else
        format.html { render :action => "edit" }
        format.xml  { render :xml => @nf_rect.errors, :status => :unprocessable_entity }
        format.fxml  { render :fxml => @nf_rect.errors }
      end
    end
  end

  # DELETE /nf_rects/1
  # DELETE /nf_rects/1.xml
  # DELETE /nf_rects/1.fxml
  def destroy
    @nf_rect = NfRect.find(params[:id])
    @nf_rect.destroy

    respond_to do |format|
      format.html { redirect_to(nf_rects_url) }
      format.xml  { head :ok }
      format.fxml  { render :fxml => @nf_rect }
    end
  end
end
